<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>qLibc: utilities/qhash.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">qLibc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('qhash_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">qhash.c File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Hash APIs.  
<a href="#details">More...</a></p>

<p><a href="qhash_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3ed9a8cb5f08fa3e3c58776a62f3f54f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhash_8c.html#a3ed9a8cb5f08fa3e3c58776a62f3f54f">qhashmd5</a> (const void *data, size_t nbytes, void *retbuf)</td></tr>
<tr class="memdesc:a3ed9a8cb5f08fa3e3c58776a62f3f54f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate 128-bit(16-bytes) MD5 hash.  <br /></td></tr>
<tr class="separator:a3ed9a8cb5f08fa3e3c58776a62f3f54f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af14399e691041012350c3a82f337970e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhash_8c.html#af14399e691041012350c3a82f337970e">qhashmd5_file</a> (const char *filepath, off_t offset, ssize_t nbytes, void *retbuf)</td></tr>
<tr class="memdesc:af14399e691041012350c3a82f337970e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get 128-bit MD5 hash of a file contents.  <br /></td></tr>
<tr class="separator:af14399e691041012350c3a82f337970e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef9d067568c8c774a1d455259612a304"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhash_8c.html#aef9d067568c8c774a1d455259612a304">qhashfnv1_32</a> (const void *data, size_t nbytes)</td></tr>
<tr class="memdesc:aef9d067568c8c774a1d455259612a304"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get 32-bit FNV1 hash.  <br /></td></tr>
<tr class="separator:aef9d067568c8c774a1d455259612a304"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e5daad0624e2ce2bf8c77da01228e0a"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhash_8c.html#a4e5daad0624e2ce2bf8c77da01228e0a">qhashfnv1_64</a> (const void *data, size_t nbytes)</td></tr>
<tr class="memdesc:a4e5daad0624e2ce2bf8c77da01228e0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get 64-bit FNV1 hash integer.  <br /></td></tr>
<tr class="separator:a4e5daad0624e2ce2bf8c77da01228e0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a433dc88e449b346a863f957421c4d2ba"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhash_8c.html#a433dc88e449b346a863f957421c4d2ba">qhashmurmur3_32</a> (const void *data, size_t nbytes)</td></tr>
<tr class="memdesc:a433dc88e449b346a863f957421c4d2ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get 32-bit Murmur3 hash.  <br /></td></tr>
<tr class="separator:a433dc88e449b346a863f957421c4d2ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac130b57203ec6f04fd0faa097bf14b6b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhash_8c.html#ac130b57203ec6f04fd0faa097bf14b6b">qhashmurmur3_128</a> (const void *data, size_t nbytes, void *retbuf)</td></tr>
<tr class="memdesc:ac130b57203ec6f04fd0faa097bf14b6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get 128-bit Murmur3 hash.  <br /></td></tr>
<tr class="separator:ac130b57203ec6f04fd0faa097bf14b6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Hash APIs. </p>

<p class="definition">Definition in file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a3ed9a8cb5f08fa3e3c58776a62f3f54f" name="a3ed9a8cb5f08fa3e3c58776a62f3f54f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ed9a8cb5f08fa3e3c58776a62f3f54f">&#9670;&#160;</a></span>qhashmd5()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qhashmd5 </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>retbuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate 128-bit(16-bytes) MD5 hash. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>source object </td></tr>
    <tr><td class="paramname">nbytes</td><td>size of data </td></tr>
    <tr><td class="paramname">retbuf</td><td>user buffer. It must be at leat 16-bytes long.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise false.</dd></dl>
<div class="fragment"><div class="line"><span class="comment">// get MD5</span></div>
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> md5hash[16];</div>
<div class="line"><a class="code hl_function" href="qhash_8c.html#a3ed9a8cb5f08fa3e3c58776a62f3f54f">qhashmd5</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5, md5hash);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// hex encode</span></div>
<div class="line"><span class="keywordtype">char</span> *md5ascii = <a class="code hl_function" href="qencode_8c.html#aff18a5ca486ff7af31425c4f012afd7a">qhex_encode</a>(md5hash, 16);</div>
<div class="line">printf(<span class="stringliteral">&quot;Hex encoded MD5: %s\n&quot;</span>, md5ascii);</div>
<div class="line">free(md5ascii);</div>
<div class="ttc" id="aqencode_8c_html_aff18a5ca486ff7af31425c4f012afd7a"><div class="ttname"><a href="qencode_8c.html#aff18a5ca486ff7af31425c4f012afd7a">qhex_encode</a></div><div class="ttdeci">char * qhex_encode(const void *bin, size_t size)</div><div class="ttdoc">Encode data to Hexadecimal digit format.</div><div class="ttdef"><b>Definition</b> <a href="qencode_8c_source.html#l00393">qencode.c:393</a></div></div>
<div class="ttc" id="aqhash_8c_html_a3ed9a8cb5f08fa3e3c58776a62f3f54f"><div class="ttname"><a href="qhash_8c.html#a3ed9a8cb5f08fa3e3c58776a62f3f54f">qhashmd5</a></div><div class="ttdeci">bool qhashmd5(const void *data, size_t nbytes, void *retbuf)</div><div class="ttdoc">Calculate 128-bit(16-bytes) MD5 hash.</div><div class="ttdef"><b>Definition</b> <a href="qhash_8c_source.html#l00067">qhash.c:67</a></div></div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00067">67</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
<a id="af14399e691041012350c3a82f337970e" name="af14399e691041012350c3a82f337970e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af14399e691041012350c3a82f337970e">&#9670;&#160;</a></span>qhashmd5_file()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qhashmd5_file </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filepath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ssize_t&#160;</td>
          <td class="paramname"><em>nbytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>retbuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get 128-bit MD5 hash of a file contents. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filepath</td><td>file path </td></tr>
    <tr><td class="paramname">offset</td><td>start offset. Set to 0 to digest from beginning of file. </td></tr>
    <tr><td class="paramname">nbytes</td><td>number of bytes to digest. Set to 0 to digest until end of file. </td></tr>
    <tr><td class="paramname">retbuf</td><td>user buffer. It must be at leat 16-bytes long.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise false.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> md5hash[16];</div>
<div class="line"><a class="code hl_function" href="qhash_8c.html#af14399e691041012350c3a82f337970e">qhashmd5_file</a>(<span class="stringliteral">&quot;/tmp/test.dat&quot;</span>, 0, 0, md5hash);</div>
<div class="ttc" id="aqhash_8c_html_af14399e691041012350c3a82f337970e"><div class="ttname"><a href="qhash_8c.html#af14399e691041012350c3a82f337970e">qhashmd5_file</a></div><div class="ttdeci">bool qhashmd5_file(const char *filepath, off_t offset, ssize_t nbytes, void *retbuf)</div><div class="ttdoc">Get 128-bit MD5 hash of a file contents.</div><div class="ttdef"><b>Definition</b> <a href="qhash_8c_source.html#l00097">qhash.c:97</a></div></div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00097">97</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
<a id="aef9d067568c8c774a1d455259612a304" name="aef9d067568c8c774a1d455259612a304"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef9d067568c8c774a1d455259612a304">&#9670;&#160;</a></span>qhashfnv1_32()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t qhashfnv1_32 </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get 32-bit FNV1 hash. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>source data </td></tr>
    <tr><td class="paramname">nbytes</td><td>size of data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>32-bit unsigned hash value.</dd></dl>
<div class="fragment"><div class="line">uint32_t hashval = <a class="code hl_function" href="qhash_8c.html#aef9d067568c8c774a1d455259612a304">qhashfnv1_32</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5);</div>
<div class="ttc" id="aqhash_8c_html_aef9d067568c8c774a1d455259612a304"><div class="ttname"><a href="qhash_8c.html#aef9d067568c8c774a1d455259612a304">qhashfnv1_32</a></div><div class="ttdeci">uint32_t qhashfnv1_32(const void *data, size_t nbytes)</div><div class="ttdoc">Get 32-bit FNV1 hash.</div><div class="ttdef"><b>Definition</b> <a href="qhash_8c_source.html#l00192">qhash.c:192</a></div></div>
</div><!-- fragment --><div class="fragment"><div class="line">Fowler/Noll/Vo hash</div>
<div class="line"> </div>
<div class="line">The basis of <span class="keyword">this</span> hash algorithm was taken from an idea sent as reviewer</div>
<div class="line">comments to the IEEE POSIX P1003.2 committee by:</div>
<div class="line"> </div>
<div class="line">    Phong Vo (http:<span class="comment">//www.research.att.com/info/kpv/)</span></div>
<div class="line">    Glenn Fowler (http:<span class="comment">//www.research.att.com/~gsf/)</span></div>
<div class="line"> </div>
<div class="line">In a subsequent ballot round:</div>
<div class="line"> </div>
<div class="line">    Landon Curt Noll (http:<span class="comment">//www.isthe.com/chongo/)</span></div>
<div class="line"> </div>
<div class="line">improved on their algorithm.  Some people tried this hash and found that</div>
<div class="line">it worked rather well. In an EMail message to Landon, they named it the</div>
<div class="line">``Fowler/Noll/Vo<span class="stringliteral">&#39;&#39;</span> or FNV hash.</div>
<div class="line"> </div>
<div class="line">FNV hashes are designed to be fast while maintaining a low collision rate.</div>
<div class="line">The FNV speed allows one to quickly hash lots of data while maintaining</div>
<div class="line">a reasonable collision rate.  See:</div>
<div class="line"> </div>
<div class="line">    http:<span class="comment">//www.isthe.com/chongo/tech/comp/fnv/index.html</span></div>
<div class="line"> </div>
<div class="line">for more details as well as other forms of the FNV hash.</div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00192">192</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
<a id="a4e5daad0624e2ce2bf8c77da01228e0a" name="a4e5daad0624e2ce2bf8c77da01228e0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e5daad0624e2ce2bf8c77da01228e0a">&#9670;&#160;</a></span>qhashfnv1_64()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t qhashfnv1_64 </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get 64-bit FNV1 hash integer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>source data </td></tr>
    <tr><td class="paramname">nbytes</td><td>size of data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>64-bit unsigned hash value.</dd></dl>
<div class="fragment"><div class="line">uint64_t fnv64 = <a class="code hl_function" href="qhash_8c.html#a4e5daad0624e2ce2bf8c77da01228e0a">qhashfnv1_64</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5);</div>
<div class="ttc" id="aqhash_8c_html_a4e5daad0624e2ce2bf8c77da01228e0a"><div class="ttname"><a href="qhash_8c.html#a4e5daad0624e2ce2bf8c77da01228e0a">qhashfnv1_64</a></div><div class="ttdeci">uint64_t qhashfnv1_64(const void *data, size_t nbytes)</div><div class="ttdoc">Get 64-bit FNV1 hash integer.</div><div class="ttdef"><b>Definition</b> <a href="qhash_8c_source.html#l00223">qhash.c:223</a></div></div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00223">223</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
<a id="a433dc88e449b346a863f957421c4d2ba" name="a433dc88e449b346a863f957421c4d2ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a433dc88e449b346a863f957421c4d2ba">&#9670;&#160;</a></span>qhashmurmur3_32()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t qhashmurmur3_32 </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get 32-bit Murmur3 hash. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>source data </td></tr>
    <tr><td class="paramname">nbytes</td><td>size of data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>32-bit unsigned hash value.</dd></dl>
<div class="fragment"><div class="line">uint32_t hashval = <a class="code hl_function" href="qhash_8c.html#a433dc88e449b346a863f957421c4d2ba">qhashmurmur3_32</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5);</div>
<div class="ttc" id="aqhash_8c_html_a433dc88e449b346a863f957421c4d2ba"><div class="ttname"><a href="qhash_8c.html#a433dc88e449b346a863f957421c4d2ba">qhashmurmur3_32</a></div><div class="ttdeci">uint32_t qhashmurmur3_32(const void *data, size_t nbytes)</div><div class="ttdoc">Get 32-bit Murmur3 hash.</div><div class="ttdef"><b>Definition</b> <a href="qhash_8c_source.html#l00263">qhash.c:263</a></div></div>
</div><!-- fragment --><div class="fragment"><div class="line">MurmurHash3 was created by Austin Appleby  in 2008. The initial</div>
<div class="line">implementation was published in C++ and placed in the <span class="keyword">public</span>.</div>
<div class="line">  https:<span class="comment">//sites.google.com/site/murmurhash/</span></div>
<div class="line">Seungyoung Kim has ported its implementation into C language</div>
<div class="line">in 2012 and published it as a part of qLibc component.</div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00263">263</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
<a id="ac130b57203ec6f04fd0faa097bf14b6b" name="ac130b57203ec6f04fd0faa097bf14b6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac130b57203ec6f04fd0faa097bf14b6b">&#9670;&#160;</a></span>qhashmurmur3_128()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qhashmurmur3_128 </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>retbuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get 128-bit Murmur3 hash. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>source data </td></tr>
    <tr><td class="paramname">nbytes</td><td>size of data </td></tr>
    <tr><td class="paramname">retbuf</td><td>user buffer. It must be at leat 16-bytes long.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise false.</dd></dl>
<div class="fragment"><div class="line"><span class="comment">// get 128-bit Murmur3 hash.</span></div>
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> hash[16];</div>
<div class="line"><a class="code hl_function" href="qhash_8c.html#ac130b57203ec6f04fd0faa097bf14b6b">qhashmurmur3_128</a>((<span class="keywordtype">void</span>*)<span class="stringliteral">&quot;hello&quot;</span>, 5, hash);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// hex encode</span></div>
<div class="line"><span class="keywordtype">char</span> *ascii = <a class="code hl_function" href="qencode_8c.html#aff18a5ca486ff7af31425c4f012afd7a">qhex_encode</a>(hash, 16);</div>
<div class="line">printf(<span class="stringliteral">&quot;Hex encoded Murmur3: %s\n&quot;</span>, ascii);</div>
<div class="line">free(ascii);</div>
<div class="ttc" id="aqhash_8c_html_ac130b57203ec6f04fd0faa097bf14b6b"><div class="ttname"><a href="qhash_8c.html#ac130b57203ec6f04fd0faa097bf14b6b">qhashmurmur3_128</a></div><div class="ttdeci">bool qhashmurmur3_128(const void *data, size_t nbytes, void *retbuf)</div><div class="ttdoc">Get 128-bit Murmur3 hash.</div><div class="ttdef"><b>Definition</b> <a href="qhash_8c_source.html#l00335">qhash.c:335</a></div></div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="qhash_8c_source.html#l00335">335</a> of file <a class="el" href="qhash_8c_source.html">qhash.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_7b5d38f1875f1b693f62ca6a108a1129.html">utilities</a></li><li class="navelem"><a class="el" href="qhash_8c.html">qhash.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7 </li>
  </ul>
</div>
</body>
</html>
